package com.yang.crawler.html.enums;


public enum HtmlTagEnum {
    PARAGRAPH("p"),
    IMG("img"),
    H("h"),
    H1("h1"),
    H2("h2"),
    H3("h3"),
    H4("h4"),
    H5("h5"),
    H6("h6");

    private String tagName;

    HtmlTagEnum(String tagName) {
        this.tagName = tagName;
    }

    public String getTagName() {
        return this.tagName;
    }

    public static HtmlTagEnum getHtmlTag(String tageName) {
        for (HtmlTagEnum value : values()) {
            if (tageName.equals(value.getTagName())) {
                return value;
            }
        }
        return null;
    }

    public static boolean containsTag(String tageName) {
        for (HtmlTagEnum value : values()) {
            if (tageName.equals(value.getTagName())) {
                return true;
            }
        }
        return false;
    }
}
